<?php
/** @var PostController $this */
/** @var Post $model */
$this->breadcrumbs=array(
	'Posts'=>array('index'),
	Yii::t('AweCrud.app', 'Manage'),
);

$this->menu=array(
	array('label' => Yii::t('AweCrud.app', 'List') . ' ' . Post::label(2), 'icon' => 'list', 'url' => array('index')),
	array('label' => Yii::t('AweCrud.app', 'Create') . ' ' . Post::label(), 'icon' => 'plus', 'url' => array('create')),
);

Yii::app()->clientScript->registerScript('search', "
$('.search-button').click(function(){
	$('.search-form').toggle();
	return false;
});
$('.search-form form').submit(function(){
	$.fn.yiiGridView.update('post-grid', {
		data: $(this).serialize()
	});
	return false;
});
");
?>

<fieldset>
    <legend>
        <?php echo Yii::t('AweCrud.app', 'Manage') ?> <?php echo Post::label(2) ?>    </legend>

<?php echo CHtml::beginForm(); ?><?php $this->widget('bootstrap.widgets.TbGridView',array(
    'id' => 'post-grid',
    'type' => 'striped condensed',
    'type'=>'striped bordered condensed',
    'itemsCssClass'=>'table table-striped',
    'selectableRows' => 10,
    'template'=>"{items}",
    'dataProvider' => $model->search(),
    'filter' => $model,
    'columns'=>array(
        array(
            'name'=>'title',
            'type'=>'raw',
            'value'=>'CHtml::link(CHtml::encode($data->title), $data->url)'
        ),
        array(
            'name'=>'status',
            'value'=>'Lookup::item("PostStatus", $data->status)',
            'filter'=>Lookup::items('PostStatus'),
        ),
        array(
            'name'=>'create_time',
            'type'=>'datetime',
            'filter'=>false,
        ),
        array(
            'class'=>'CButtonColumn',
        ),
    ),
)); ?>
</fieldset>
<?php echo CHtml::endForm(); ?>